Derivatives problem 11.mws

1. Linear approximations.

If f is a function which is differentiable at x = a , then its linearization at a is the function L given by the formula L(x) = f(a)+D(f)(a)*(x-a) .

Notice that y = L(x) is just the equation of the tangent line at x = a . A main idea of the section on the differential is that the tangent line gives a good approximation to the function for values of x near x = a .

Consider the function

> f:=x->sqrt(x+3);

f := proc (x) options operator, arrow; sqrt(x+3) en...

Let us find the linearization at x = 1 and determine how good an approximation it gives to the original function. First, we find the values of the function and its derivative at x = 1 .

> f(1);D(f)(1);

2

1/4

Next, we define the linearization at x = 1 .

> L:=x->1/4*(x-1)+2;

L := proc (x) options operator, arrow; 1/4*x+7/4 en...

Just to be sure that this really is the tangent line to the curve y = f(x) at the point (1,2), let us graph the function and its tangent line near this point.

> plot([f(x),L(x)],x=0..2);

[Maple Plot]

Notice that the graph of the function and its tangent line are close on the whole interval 0 .. 2 . To be more precise about the notion of closeness, let us determine an interval on which  abs(f(x)-L(x)) < .1 .

> solve(abs(f(x)-L(x)) < .1,x);

RealRange(Open(-1.129822128),Open(3.929822128))

Sometimes Maple cannot find the solution for you using the solve command. Then you can plot abs(f(x)-L(x)) near x = a and find an interval by experiment. For example, in this case, if we let delta = 2 , and plot abs(f(x)-L(x)) on the interval ( 1-delta, 1+delta ,) then we will see that the inequality abs(f(x)-L(x)) < .1 is satisfied.

> delta:=2;plot([-.1,.1,abs(f(x)-L(x))],x=1-delta .. 1+delta,color=[red,red,blue]);

delta := 2

[Maple Plot]

From this plot, we know that the tangent line can be used to estimate the value of f(x) to within .1 on the interval ( -1, 3 ). Actually, using the interval we obtained from the solve command, we see that the tangent line estimates the value of f(x) to within .1 on the interval (-1.1, 3.9). Using this fact, we can estimate values of f for x values in this interval very easily. For example, if we want to approximate f(.2e-1) , we can simply evaluate

> L(0.02);

1.755000000

and be sure that our estimate is off by less than 0 .1. Although we did this by Maple, it is easy to calculate values of a linear function by hand as well, so if you are ever on a boat in a lake without a calculator, you can easily estimate values of even complicated functions by using the tangent line.

Submission:

For the function f(x) = cos(x) , find the linearization at x = Pi/6 and use it to estimate the value of f(.5) . Then find an interval including x = Pi/6 on which the linear approximation is accurate to within 0.1. Show how you found this interval. Finally, illustrate this fact by plotting on a single graph the function and its linearization on this interval.

Submission worksheet:

 

2. Estimating the error in using the linearization to approximate the function.

In this activity, we will estimate the magnitude of the error in using the linearization in place of the function over a specified interval. First, let us define the linear approximation for a function at a point ( a, f(a) ). Of course, this linear approximation is just the tangent line at x = a .

> L:=x->D(f)(a)*(x-a)+f(a);

L := proc (x) options operator, arrow; D(f)(a)*(x-a...

Let us study a specific function, and a specific value of a .

> a:=1;

a := 1

> f:=x->(x+1)*exp(x)+5;

f := proc (x) options operator, arrow; (x+1)*exp(x)...

> L(x);

3*exp(1)*(x-1)+2*exp(1)+5

> plot([L,f],0..2,0..40,color=[blue,red]);

[Maple Plot]

This plot gives us a visual estimate of the absolute error abs(f(x)-L(x)) over the interval [ 0, 2 ]. We could also plot this absolute error directly.

> plot(abs(f(x)-L(x)),x=0..2);

[Maple Plot]

Note that at x = 1 , the error is equal to zero. This is no accident, because the tangent line always agrees with the function at the point ( a, f(a) ). Now suppose that we wanted to control the error, by requiring that abs(f(x)-L(x)) < epsilon , for some small positive value of epsilon . We would like to find a value of delta such that the inequality abs(f(x)-L(x)) < epsilon is satisfied if abs(x-a) < delta . Let us choose epsilon = .1 , and see how to do this by using the graph. First we define epsilon , and choose a preliminary estimate for delta .

> epsilon:=.1;delta:=.2;

epsilon := .1

delta := .2

> plot([-epsilon,abs(f(x)-L(x)),epsilon],x=a-delta..a+delta,color=[blue,red,blue]);

[Maple Plot]

If the value of delta that we chose worked, the graph of the function would lie entirely between the two blue lines. It appears that if we modify our choice of delta, we can accomplish this task.

> delta:=.1;

delta := .1

> plot([-epsilon,abs(f(x)-L(x)),epsilon],x=a-delta..a+delta,color=[blue,red,blue]);

[Maple Plot]

From the plot above, we see that if abs(x-1) < .1 , then abs(f(x)-L(x)) < .1 .

Submission:

Using the ideas presented above , estimate the magnitude of the error in using the linearization in place of the function f(x) = (x-1)/(4*x^2+1) over the interval [ -3/4, 1 ] using a = 1/2 . You should perform the following steps.

(a) Plot the function over the interval.

(b) Find the linearization L of the function at 1/2 .

(c) Plot f and L together on a single set of axes.

(d) Plot the absolute error abs(f(x)-L(x)) over the interval and find its maximum value.

(e) From your graph in part iv), estimate as large a delta >0 as you can satisfying  abs(x-a) < delta implies abs(f(x)-L(x)) < epsilon for epsilon = 0.5 , 0.1, and 0.01 . Then check graphically to see if your delta - estimate holds true.

Submission worksheet:

 

3. The quadratic approximation to a function.

The quadratic approximation to a function f is defined by:

> Q(x) = `@@`(D,2)(f)(a)*(x-a)^2/2+D(f)(a)*(x-a)+f(a)...

Let us define it as a function in Maple.

> Q:=x-> (D@@2)(f)(a)*(x-a)^2/2+D(f)(a)*(x-a)+f(a);

Q := proc (x) options operator, arrow; 1/2*`@@`(D,2...

Let us consider the function f(x) = 1/(1-x) .

> f:=x->1/(1-x);

f := proc (x) options operator, arrow; 1/(1-x) end ...

Let us graph the function and its quadratic approximation near x = 0 .

> a:=0;

a := 0

> plot([Q,f],a-1..a+1,f(a)-1..f(a)+1,color=[blue,red]);

[Maple Plot]

Certainly, we do see that the quadratic approximation is very close to the value of the function, near zero. There is something else very interesting going on in this picture. In order to see what it is, you will be asked in the submission part to graph some other quadratic approximations.

Submission:

(a) Find the quadratic approximation to the following functions and graph the function together with its quadratic approximation:

  1. f(x) = 1/x at x = 1 .

  2. g(x) = sqrt(1+x) at x = 0 .

(b) Make an observation based on the three plots you have seen. This observation should lead you to a conjecture or guess, about the relationship between the graph of a function and that of its quadratic approximation. Write your observation and conjecture in one or two paragraphs.

Submission worksheet:

 

4. Quadratic approximations.

The quadratic approximation formula is similar to the linear approximation formula, and it is given by:
y = f(a)+D(f)(a)*(x-a)+`@@`(D,2)(f)(a)*(x-a)^2/2

Sometimes we call the graph of the quadratic approximation formula "the parabola of best fit", by analogy with the tangent line, which is the "line of best fit".  Let us compute the formula for the quadratic approximation of the function of activity 1 at x = 1 using Maple.

> f:=x->sqrt(x+3);

f := proc (x) options operator, arrow; sqrt(x+3) en...

> Q:=x->f(1)+D(f)(1)*(x-1)+1/2*(D@@2)(f)(1)*(x-1)^2;

Q := proc (x) options operator, arrow; f(1)+D(f)(1)...

Notice that Maple does not show you the values that it substitutes in for f(1) , D(f)(1) , and `@@`(D,2)(f)(1) . But we can find the equation by asking Maple to evaluate the function Q at x .

> Q(x);

7/4+1/4*x-1/64*(x-1)^2

Let us plot the function and its quadratic approximation at x = 1 on the same graph.

> plot([f(x),Q(x)],x=-3..5,color=[blue,red]);

[Maple Plot]

We can also use Maple to tell us the interval on which the approximation is accurate to within .1.

> solve(abs(f(x)-Q(x))<0.1,x);

RealRange(Open(-1.937346897),Open(5.387051747))

Notice that this interval is much larger than the interval on which the linear approximation is accurate to within .1 that you computed in the previous activity.  Let us use the quadratic approximation to estimate the value of f(.2e-1) , and compare it to the actual value.

> Q(0.02);f(0.02);

1.739993750

1.737814720

Submission:

For the function f(x) = cos(x) , find the quadratic approximation at x = Pi/6 and use it to estimate the value of f(.5) . Then find an interval including x = Pi/6 on which the quadratic approximation is accurate to within 0.1. Finally, illustrate this fact by graphing the function, its linearization (from activity 1) and its quadratic approximation on this interval in the same picture.

Submission worksheet: